#include <modules\system\system_gadget.h>

namespace DelGE
{
	namespace Modules
	{
		namespace System
		{
			SystemGadget::SystemGadget()
			{
				this->pInterface = NULL;
			}

			SystemGadget::SystemGadget(InterfaceSystemGadget *pImplementation)
			{
				this->pInterface = pImplementation;
			}

			SystemGadget::~SystemGadget()
			{
				delete this->pInterface;
				this->pInterface = NULL;
			}

			DelGESystemGadgetType SystemGadget::GetGadgetType()
			{
				return this->pInterface->GetGadgetType();
			}

			void SystemGadget::SetSize(int iWidth, int iHeight)
			{
				return this->pInterface->SetSize(iWidth, iHeight);
			}

			void SystemGadget::SetWidth(int iWidth)
			{
				this->pInterface->SetWidth(iWidth);
			}

			void SystemGadget::SetHeight(int iHeight)
			{
				this->pInterface->SetHeight(iHeight);
			}

			int SystemGadget::GetWidth()
			{
				return this->pInterface->GetWidth();
			}

			int SystemGadget::GetHeight()
			{
				return this->pInterface->GetHeight();
			}

			void SystemGadget::SetPosition(int iX, int iY)
			{
				this->pInterface->SetPosition(iX, iY);
			}

			void SystemGadget::SetPositionX(int iX)
			{
				this->pInterface->SetPositionX(iX);
			}

			void SystemGadget::SetPositionY(int iY)
			{
				this->pInterface->SetPositionY(iY);
			}

			int SystemGadget::GetPositionX()
			{
				return this->pInterface->GetPositionX();
			}

			int SystemGadget::GetPositionY()
			{
				return this->pInterface->GetPositionY();
			}

			int SystemGadget::GetClientPositionX()
			{
				return this->pInterface->GetClientPositionX();
			}

			int SystemGadget::GetClientPositionY()
			{
				return this->pInterface->GetClientPositionY();
			}

			bool SystemGadget::IsMouseInside()
			{
				return this->pInterface->IsMouseInside();
			}

			bool SystemGadget::HasFocus()
			{
				return this->pInterface->HasFocus();
			}

			void SystemGadget::SetFocus()
			{
				this->pInterface->SetFocus();
			}

			int SystemGadget::ScreenPositionXToClientPositionX(int iScreenPositionX)
			{
				return this->pInterface->ScreenPositionXToClientPositionX(iScreenPositionX);
			}

			int SystemGadget::ScreenPositionYToClientPositionY(int iScreenPositionY)
			{
				return this->pInterface->ScreenPositionYToClientPositionY(iScreenPositionY);
			}

			int SystemGadget::ClientPositionXToScreenPositionX(int iClientPositionX)
			{
				return this->pInterface->ClientPositionXToScreenPositionX(iClientPositionX);
			}

			int SystemGadget::ClientPositionYToScreenPositionY(int iClientPositionY)
			{
				return this->pInterface->ClientPositionYToScreenPositionY(iClientPositionY);
			}

			InterfaceSystemGadget* SystemGadget::GetInterfaceGadget() const
			{
				return this->pInterface;
			}

			bool operator ==(const SystemGadget &pGadget0, const SystemGadget &pGadget1)
			{
				return (pGadget0.GetInterfaceGadget() == pGadget1.GetInterfaceGadget());
			}

			bool operator !=(const SystemGadget &pGadget0, const SystemGadget &pGadget1)
			{
				return !(pGadget0 == pGadget1);
			}
		}
	}
}